package com.yhy.service;

import com.yhy.mapper.StudentMapper;
import com.yhy.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {
    @Autowired
    private StudentMapper studentMapper;

    public List<Student> findAll() {
        return studentMapper.findAll();
    }

    public Student findById(Long id) {
        return studentMapper.findById(id);
    }

    public void insert(Student student) {
        studentMapper.insert(student);
    }

    public void update(Student student) {
        studentMapper.update(student);
    }

    public void deleteById(Long id) {
        studentMapper.deleteById(id);
    }
}
